package edu.kit.aifb.ldstream.learner.dao;

import java.io.Serializable;

import org.openrdf.model.URI;

public class Type implements Serializable{


	private static final long serialVersionUID = -245675008425793615L;

	private URI uri;
	
	private double coverage;
	private double weight;
	
	transient private int numProps = 0;
	
	public Type(URI uri){
		this.uri = uri;
	}
	
	public URI getURI(){
		return this.uri;
	}
	
	public void setNumProperties(int num){
		this.numProps = num;
	}
	
	public void setCoverageWeight(double w){
		if(w < 0 || w > 1) {
			throw new IllegalArgumentException("CoverageWeight must be between 0 and 1");
		}
		this.weight = w;
	}
	
	public double getCoverageWeight(){
		return this.weight;
	}
	
	public void setCoverage(double cv){
		if(cv < 0 || cv > 1) {
			throw new IllegalArgumentException("Coverage must be between 0 and 1");
		}
		this.coverage = cv;
	}
	
	public double getCoverage(){
		return this.coverage;
	}
	public int getNumProps(){
		return this.numProps;
	}
	
	public boolean equals(Object o){
		if(o instanceof Type){
			return this.uri.equals(((Type) o).uri);
		}
		return false;
	}
	
	public int hashCode(){
		return this.uri.hashCode();
	}
	
	public String toString(){
		return this.uri.toString();
	}
}
